package com.itheima.design.mode.strategy.service;

import com.itheima.design.mode.strategy.entity.Order;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class OrderServiceV4 {

    @Autowired
    PromotionCalculationFactory promotionCalculationFactory;

    public Order prepareOrder(Order order, String promotion) {
        return promotionCalculationFactory.getPromotionCalculation(promotion).calulate(order);
    }
}
